﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;
using System.ServiceModel.Description;
using WcfContrib.Errors;
using WcfContrib.Hosting;

namespace WcfContrib.Showcase.Service
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                //There is also a ServiceHostFactory for use within IIS

                ServiceHost<Service> h = new ServiceHost<Service>();

                h.Open();

                Console.WriteLine("Service is up, press 'Enter to exit'");
                Console.ReadLine();

                h.Close();
            }
            catch (Exception ex)
            {
                Console.ForegroundColor = ConsoleColor.Yellow;
                Console.WriteLine("Error: " + ex.ToString());
                Console.ReadLine();
            }
        }
    }
}
